"""
 异常的应用
"""


def get_input():
    """
        添加异常处理，即使输入错误也不会退出程序
    """
    my_list = []
    while True:
        str_count = input("输1-100入数字：")
        if str_count == '':
            break
        try:
            lo = int(str_count)
            if 0 <= lo <= 100:
                my_list.append(lo)

        except ValueError as e:
            print(f"{e}输入正确的值！")
            continue

    return my_list


print(get_input())
